package com.ayu.scalalearn.chapter07

/**
  * @Author 徐林玉
  * @Description Test03MultiArray
  * @Date 2022/8/3 13:49
  * @Version 1.0
  */
object Test03MultiArray {
  def main(args: Array[String]): Unit = {

    //1、声明多维数组
    val array: Array[Array[Int]] = Array.ofDim[Int](2, 3)

    //2、访问元素
    array(0)(1) = 10
    array(0)(2) = 20
    array(1)(0) = 30
    array(1)(2) = 40

    array.foreach(line => {
      line.foreach(elem => {
        print(elem + "\t")
      })
      println()
    })


  }

}
